package com.service.impl;

import com.mapper.IndentMapper;
import com.pojo.Agreer;
import com.pojo.Indent;
import com.pojo.Measurement;
import com.pojo.State;
import com.service.IndentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Service
@Transactional
public class IndentServiceImpl implements IndentService {
    @Autowired
    public IndentMapper mapper;
    //    查询销售经理提交审批订单可模糊查询
    @Override
    public List<Map<String,Object>> indentFindManager(String ename,Integer iid,String firm,Integer roleid) {
        return mapper.indentFindManager(ename,iid,firm,roleid);
    }


    //    查询所有订单状态
    @Override
    public List<Map<String, Object>> indentFindAll(String ename, Integer iid, String firm) {
        return mapper.indentFindAll(ename, iid, firm);
    }


    //    查询老板审批订单
    @Override
    public List<Map<String, Object>> indentFindBoss(String ename, Integer iid, String firm,Integer roleid) {
        return mapper.indentFindBoss(ename, iid, firm,roleid);
    }


    //    采购员只能查看自己提交的订单
    @Override
    public List<Map<String, Object>> indentFindBuyer(String ename, Integer iid, String firm, Integer empno) {
        return mapper.indentFindBuyer(ename, iid, firm, empno);
    }


    //    创建采购订单
    @Override
    public List<Measurement> measurementSelect(Integer mid,String mbig,Integer scale,String mlittle) {
        return mapper.measurementSelect(mid, mbig, scale, mlittle);
    }
    @Override
    public int measurementInsert(Measurement measurement) {
        return mapper.measurementInsert(measurement);
    }
    @Override
    public List<State> stateSelect(Integer staid) {
        return mapper.stateSelect(staid);
    }
    @Override
    public int stateInsert(Integer staid) {
        return mapper.stateInsert(staid);
    }
    @Override
    public List<Indent> indentSelect(Integer iid) {
        return mapper.indentSelect(iid);
    }
    @Override
    public int indentInsert(Indent indent) {
        return mapper.indentInsert(indent);
    }


    //    经理审批修改
    @Override
    public int rankUpd(Integer iid, Integer rank) {
        return mapper.rankUpd(iid, rank);
    }
    @Override
    public int managerUpd(Integer staid, Integer manager,Integer payment) {
        return mapper.managerUpd(staid, manager,payment);
    }
    @Override
    public List<Agreer> agreerSelect(Integer agrid) {
        return mapper.agreerSelect(agrid);
    }
    @Override
    public int agreerInsert(Agreer agreer) {
        return mapper.agreerInsert(agreer);
    }


    //    修改订单数量
    @Override
    public int indentUpdNum(Integer iid, Integer num) {
        return mapper.indentUpdNum(iid, num);
    }

    @Override
    public int indentUpdDt(Integer staid, Date deliveryTime) {
        return mapper.indentUpdDt(staid, deliveryTime);
    }


    //    订单确认，等待付款
    @Override
    public int indentUpdAffirm(Integer iid, Integer rank) {
        return mapper.indentUpdAffirm(iid, rank);
    }

    //查看财务
    @Override
    public List<Map<String, Object>> indentFindFinance(Integer roleid) {
        return mapper.indentFindFinance(roleid);
    }


    //        财务确认，付款完成
    @Override
    public int stateUpdPayment(Integer staid, Integer payment) {
        return mapper.stateUpdPayment(staid, payment);
    }


    //    取消订单
    @Override
    public int indentDel(Integer iid) {
        return mapper.indentDel(iid);
    }
    @Override
    public int measurementDel(Integer mid) {
        return mapper.measurementDel(mid);
    }
    @Override
    public int stateDel(Integer staid) {
        return mapper.stateDel(staid);
    }


    //保管员可查看订单
    @Override
    public List<Map<String, Object>> indentVerify(Integer roleid) {
        return mapper.indentVerify(roleid);
    }


    //    实际到货数量
    @Override
    public int indentUpdFact(Integer iid, Integer fact) {
        return mapper.indentUpdFact(iid, fact);
    }


    //    保管员确定后修改接 核 结 截
    @Override
    public int stateUpdRVEE(Integer staid, Integer verify, Date endTime) {
        return mapper.stateUpdRVEE(staid, verify, endTime);
    }

}
